package com.share.lottery.utils;

import java.util.List;
import java.util.Map;

public class ObjTool {
	/**
	 * 
	 * @Description:TODO判断字符串是否为空
	 * @param@param str
	 * @param@return
	 * @return boolean
	 * @author zhuw
	 * @date 2013-11-21 上午11:27:14
	 */
	public static boolean isNotNull(String str) {
		boolean flag = true;
		if (null == str || "".equals(str.trim())
				|| str.trim().equalsIgnoreCase("null")) {
			flag = false;
		}
		return flag;

	}

	/**
	 * 
	 * @Description:TODO判断字符串数组是否为空
	 * @param@param strArray
	 * @param@return
	 * @return boolean
	 * @author zhuw
	 * @date 2013-11-21 上午11:28:07
	 */
	public static boolean isNotNull(String[] strArray) {
		boolean flag = true;
		if (null == strArray || strArray.length == 0) {
			flag = false;
		}
		return flag;

	}

	/**
	 * 
	 * @Description:TODOList是否为空
	 * @param@param list
	 * @param@return
	 * @return boolean
	 * @author zhuw
	 * @date 2013-11-21 上午11:28:50
	 */
	public static boolean isNotNull(List list) {
		boolean flag = true;
		if (null == list || 0 == list.size()) {
			flag = false;
		}
		return flag;
	}

	/**
	 * 
	 * @Description:TODO Map是否为空
	 * @param@param map
	 * @param@return
	 * @return boolean
	 * @author zhuw
	 * @date 2013-11-21 上午11:29:52
	 */
	public static boolean isNotNull(Map map) {
		boolean flag = true;
		if (null == map || 0 == map.size()) {
			flag = false;
		}
		return flag;
	}

	/**
	 * 
	 * @Description:TODO对象数组是否为空
	 * @param@param obj
	 * @param@return
	 * @return boolean
	 * @author zhuw
	 * @date 2013-11-21 上午11:29:19
	 */
	public static boolean isNotNull(Object... obj) {
		boolean flag = true;
		if (null == obj || 0 == obj.length || null == obj[0]) {
			flag = false;
		}
		return flag;
	}

	/**
	 * 
	 * @Description:TODO对象是否为空
	 * @param@param obj
	 * @param@return
	 * @return boolean
	 * @author zhuw
	 * @date 2013-11-21 上午11:29:19
	 */
	public static boolean isNotNull(Object obj) {
		boolean flag = true;
		if (null == obj) {
			flag = false;
		}
		return flag;
	}
}
